import { templatePageEnum } from '../constants/enum-data';
import { IProConditions } from 'legions-pro-design/es/LegionsProConditions/ProConditionsUtils';
import { ITableColumnConfigProps } from 'legions-pro-design/es/LegionsProTable/interface';
export type IQuery=Array<IProConditions['componentModel']>
const ALL_SUITS = [
  'export',
  'import',
  'enabled',
  'disable',
  'delete',
	'customColumns',
	'openCustomColumns',
] as const;
export type SuitTuple = typeof ALL_SUITS;
export declare namespace ProjectModules {
  interface ISendData {
    /**
     *
     * 系统模块
     * @type {String}
     * @memberof ISendData
     */
    modulesSystem: string;
    gitSrc: string;
    gitPwd?: string;
    projectSrc: string;
    branch: string;
    gitUserName: string;
    templateType: keyof typeof templatePageEnum;
    componentName: string;
  }
}
export interface ITableBaseConfigCode {
  isExportCurrData: string;
  isOpenCustomColumns: string;
  isOpenRowChange: string;
  tableModulesName: string;
  token: string;
  uniqueKey: string;
	columns: any[];
}
export interface IOperationConfigCode {
  onClick?: () => void;
  type: SuitTuple[number];
  btnType: string;
  btnIcon: string;
  name: string;
  API: string;
}
interface IAst {
  selectAutoQueryList?: any[];
  /*** 搜索条件配置数据*/
  queryAst?: Array<IProConditions['componentModel']>;
  /*** 表格列配置数据信息*/
  tableAst?: ITableColumnConfigProps[];

  /** 表格数据源配置代码*/
  tableDataSourceAst?: {
    apiUrl: string;
    method: 'get' | 'post';
    options: string;
    transform: string;
    model: string;
    token: string;
    onSearch: string;
    onReset: string;
    parames: string;
  };
  /** * 表格基础配置数据 */
  tableBaseConfigAst?: ITableBaseConfigCode;

  /**
   * table 操作区域
   *
   * @type {IOperationConfigCode[]}
   * @memberof IAst
   */
  operationAst?: IOperationConfigCode[];
}

export interface ISendAst{
	ast: IAst;
	tablePageListCode?: {
		/*** 列表主组件代码*/
		tableHomePageCode: string;
		tableModelCode: string;
	};
	formPageCode?: {
		modelCode: string;
		formComponentCode: string;
	};
	/*** 模板类型 表单或者列表*/
	templateType: keyof typeof templatePageEnum;

	/*** 文件存储路径 */
	projectSrc: string;

	/** * 存放模块*/
	modulesSystem: string;
	 /*** 仓库地址*/
	gitSrc: string;
	branch: string;
	gitUserName: string;
	componentName: string;
}
export interface IDirective {
	initProject?: {
	  sendData: ProjectModules.ISendData;
	  readonly responseData?: string;
	  readonly state?: 'none' | 'pending' | 'complete';
	};
	generatedCode?: {
	  sendData: ISendAst;
	  readonly responseData?: string;
	  readonly state?: 'none' | 'pending' | 'complete';
	};
}